export default (e,type = 'yyyy-mm-dd h:m:s')=>{
    //console.log( e );
    let t = new Date(e)
    //console.log( t,e );
    let year = t.getFullYear()
    let month = t.getMonth() + 1 + ''
        month = month.padStart(2,0)
    let day = t.getDate() + ''
        day = day.padStart(2,0)
    let h = t.getHours() + ''
        h =  h.padStart(2,0)
    let m = t.getMinutes() + ''
        m = m.padStart(2,0)
    let s = t.getSeconds() + ''
        s = s.padStart(2,0)



    if( type == 'yyyy-mm-dd h:m:s' ){
        return `${year}-${month}-${day} ${h}:${m}:${s}`
    }else if(type =='yyyy-mm-dd' ){
        return `${year}-${month}-${day}`
    }else if(type =='h:m:s' ){
        return `${h}:${m}:${s}`
    }else{
        return `${year}/${month}/${day}`
    }

    
}